/**
 * Created by SXY on 2016/3/11.
 */
openerp.subbar_demo = function(instance, local) {
    var _t = instance.web._t,
        _lt = instance.web._lt;
    var QWeb = instance.web.qweb;

    local.HomePage = instance.Widget.extend({
        start: function() {
            this.$el.append("<div>APS result</div>");
            this.$el.append('<div id="main"style="height:400px"></div>');

            //this.$el.append(QWeb.render("ImageShowTemplate"));
            $("body").append('<script type="text/javascript">require.config({paths:{echarts:"http://echarts.baidu.com/build/dist"}}),require(["echarts","echarts/chart/bar"],function(t){var e=t.init(document.getElementById("main")),a={tooltip:{show:!0},legend:{data:["test"]},xAxis:[{type:"category",data:["1","2","3","4","5","6"]}],yAxis:[{type:"value"}],series:[{name:"test",type:"bar",data:[5,20,40,10,10,20]}]};e.setOption(a)});</script>')
            this.$(".my_button").click(function() {
            console.log("button click success!!");
            });
        },
    });

    instance.web.client_actions.add('image.homepage', 'instance.subbar_demo.HomePage');
}